/*******************************************************
> Copyright (C) 2024 ==IOT== All rights reserved.
> File Name: static.c
> Author: IOT
> Website:www.slq.org
> Created Time: 2024年10月21日 星期一 16时18分31秒
***************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>

static int count; // 限制作用范围
void fun();

int main(int argc,const char* argv[])
{
	int m = 0;
	//static int n = 0;

//	printf("the addr of m and n:%p,%p\n", &m, &n);
	fun();
	fun();
	fun();
	fun();
	fun();

    return 0;
}

void fun()
{
	static int n = 0;
	n++;
	printf("n = %d\n", n);
}

